﻿@model IEnumerable<Orion.Models.Adverty>

@{
    ViewBag.Title = "IRIS Innranet - Auglýsingar";
    Layout = "~/Views/Shared/_WorkLayout.cshtml";
}
<section id="main_content_wrapper">
<h1>Auglýsingar</h1>

<p>@Html.ActionLink("Búa til auglýsingu", "Create", "Advertiesment")</p>

@foreach (var item in @Model)
{
    <section id="main_content">
        <h1>Auglýsandi: @item.ClientName</h1>
        <p>Byrjar:  @item.StartDate.ToString("dd MMMM yy")</p>
        <p>Endar:  @item.EndDate.ToString("dd MMMM yy")</p>  
        <b>@Html.ActionLink("Breyta auglýsingu", "Edit/" + @item.ID, "Advertiesment")</b>
        
        @if (item.Valid == true)
        {
            @Html.ActionLink("Taka af forsíðu", "ChangeValid/" + @item.ID, "Advertiesment")
        }
        else
        {
            @Html.ActionLink("Setja á forsíðu", "ChangeValid/" + @item.ID, "Advertiesment")
        }
    </section>
    
}
</section>

